﻿using System;
using System.Collections.Generic;

namespace Ayatta.Contract.Domain
{
    /// <summary>
    /// 游戏文章
    /// </summary>
    public class GameArticle : BaseEntity<int>
    {
        /// <summary>
        /// 游戏Id
        /// </summary>
        public int GameId { get; set; }

        /// <summary>
        /// 分类
        /// </summary>
        public GameArticleCategory Category { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        public string Title { get; set; }

        /// <summary>
        /// 副标题
        /// </summary>
        public string SubTitle { get; set; }

        /// <summary>
        /// 摘要
        /// </summary>
        public string Summary { get; set; }

        /// <summary>
        /// 内容
        /// </summary>
        public string Content { get; set; }

        /// <summary>
        /// 是否为父节点
        /// </summary>
        public bool IsParent { get; set; }

        /// <summary>
        /// 父Id
        /// </summary>
        public int ParentId { get; set; }

        /// <summary>
        /// 标识
        /// </summary>
        public int Flag { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        public GameArticleStatus Status { get; set; }

        /// <summary>
        /// 最后一次更新时间
        /// </summary>
        public DateTime ModifiedOn { get; set; }


        public static IDictionary<GameArticleCategory, string> CategoryDic
        {
            get
            {
                var dic = new Dictionary<GameArticleCategory, string>();
                dic.Add(GameArticleCategory.Notice, "公告");
                dic.Add(GameArticleCategory.News, "新闻");
                dic.Add(GameArticleCategory.Activity, "活动");
                dic.Add(GameArticleCategory.Guide, "攻略");
                dic.Add(GameArticleCategory.Information, "资料");
                dic.Add(GameArticleCategory.Wallpaper, "游戏壁纸");
                dic.Add(GameArticleCategory.Screenshot, "游戏截图");
                dic.Add(GameArticleCategory.Other, "其它");
                return dic;
            }
        }

        public static IDictionary<GameArticleStatus, string> StatusDic
        {
            get
            {
                var dic = new Dictionary<GameArticleStatus, string>();
                dic.Add(GameArticleStatus.PrePublish, "预发布");
                dic.Add(GameArticleStatus.Published, "已发布");
                dic.Add(GameArticleStatus.Deleted, "已删除");
                return dic;
            }
        }

        public static IDictionary<int, string> FlagDic
        {
            get
            {
                var dic = new Dictionary<int, string>();
                dic.Add(1, "置顶");
                dic.Add(2, "加粗");
                dic.Add(4, "红色");
                return dic;
            }
        }
    }

    public enum GameArticleCategory : byte
    {
        /// <summary>
        /// 公告
        /// </summary>
        Notice = 0,

        /// <summary>
        /// 新闻
        /// </summary>
        News = 1,

        /// <summary>
        /// 活动
        /// </summary>
        Activity = 2,

        /// <summary>
        /// 攻略
        /// </summary>
        Guide = 3,

        /// <summary>
        /// 资料
        /// </summary>
        Information = 5,

        /// <summary>
        /// 游戏壁纸
        /// </summary>
        Wallpaper = 6,

        /// <summary>
        /// 游戏截图
        /// </summary>
        Screenshot = 7,

        /// <summary>
        /// 其它
        /// </summary>
        Other
    }

    public enum GameArticleStatus : byte
    {
        /// <summary>
        /// 预发布
        /// </summary>
        PrePublish = 0,
        /// <summary>
        /// 已发布
        /// </summary>
        Published = 1,
        /// <summary>
        /// 已删除
        /// </summary>
        Deleted = 2
    }
}